﻿using Volo.Abp.Users;

namespace FlyingEye.Extensions
{
    public static class ApplicationServiceExtensions
    {
        public static void Verify(this ICurrentUser currentUser)
        {
            if (!currentUser.IsAuthenticated)
            {
                throw new InvalidOperationException("未进行身份认证！");
            }

            if (currentUser.Id == null)
            {
                throw new InvalidOperationException("用户 ID 不存在！");
            }
        }
    }
}
